package com.health.controller;

import com.health.pojo.Users;
import com.health.service.UserService;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

// 用户个人信息查询
@WebServlet(value = "/editInformation")
public class EditInformationServlet extends HttpServlet {
    UserService userService = new UserService();

    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        // 接收session的用户id参数
        Integer userId = ((Users) request.getSession().getAttribute("user")).getUserId();
        Users user = new Users();
        user = userService.searchInformation(user, userId);
        request.setAttribute("asideStatus", 3);
        request.setAttribute("user1", userId);
        request.setAttribute("user", user);
        request.getParameter("nameText");
        request.getRequestDispatcher("/restrictedPages/main.jsp").forward(request, response);
    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}
